package excep;

import java.io.FileNotFoundException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.logging.Logger;

public class ExcepApp {

    private static Random generator = new Random();

    public static int randInt(int low, int high) {
        if (low > high) {
            throw new IllegalArgumentException( // this is no seence
                String.format("low should be <= high but low is %d and high is %d", low, high)
            );
        }
        return low + (int)(generator.nextDouble()*(high-low+1));
    }

    public void start() {

        // int res = randInt(10, 5);
        // System.out.println(res);

        System.out.println("ExcepApp");

        // List list = new ArrayList<>();
        // list.forEach(obj->write(obj, "output.dat")); // error

        Logger.getGlobal().info("first log");
    }

    public void write(Object obj, String filename) throws FileNotFoundException {
        return;
    }


}